import { Component, OnInit,Input,Output, EventEmitter,ViewChild, ViewContainerRef } from '@angular/core'
import { FormGroup, FormBuilder } from '@angular/forms'
import { ModalService } from '@app/shared/utils'
import { NetService, PageService } from '@app/core/http'
import { ApiService } from '../../services/dashboard.service'
import { QlMessageService } from 'qloud-angular'
import { Router } from '@angular/router'
import $ from 'jquery';

@Component({
  selector: 'app-task',
  templateUrl: './task.component.html',
  styleUrls: ['./task.component.css'],
  providers: [ModalService, PageService, ApiService]
})
export class TaskComponent implements OnInit {
    @Input()  hdata9: any; // 接收父组件传递的高度值
    @Input()  wdata9: any;

    public datatask:any = ''

    index ='1';
    tabIndex = '1';

    tasks: Array<Object> = [];
    tasks1: Array<Object> = [];
    tasks2: Array<Object> = [];
    tasks3: Array<Object> = [];

    constructor(
      private apiService: ApiService,
      private fb: FormBuilder,
      public modal: ModalService,
      public pageService: PageService,
      private message: QlMessageService,
      private router: Router
    ) {

    }

    ngOnInit() {
      this.apiService.gettaskList().subscribe(data => {
        this.datatask = data
        this.tasks = data.slice(0,4)
        this.tasks1 = data.slice(4,8)
        this.tasks2 = data.slice(8,12)
        this.tasks3 = data.slice(12,13)
      })
    }
    ngOnChanges() {
    }

  handle(index: string): void {
    this.tabIndex = index;
  }
}
